package demo1;

public class Test2 {
    public static void test1(Animal animal){
        animal.eat();
    }

    public static void test2(IRunning iRunning){
        iRunning.run();
    }
    public static void test3(ISwimming iSwimming){
        iSwimming.swim();
    }
    public static void test4(IFlying iFlying){
        iFlying.fly();
    }
    public static void test5(Dog dog){
        dog.eat();
    }

    public static void main(String[] args) {
        Bird bird = new Bird("小鸟" , 10);
        Dog dog = new Dog("小狗" , 10);
        test1(bird);
        test1(dog);
        test5(dog);
        test2(bird);
        test2(new Robot());


    }

}
